﻿using FB.Providers.EmployeeInfo;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace FCDB.Web.Models
{
    public class DepartmentModel : Department
    {
        public string ParentName { get; set; }
        public string CompanyName { get; set; }
        public DepartmentModel()
        {
        }
        public DepartmentModel(Department dept)
        {
            COMCode = dept.COMCode;
            Company = dept.Company;
            CompanyName = dept.Company.Name;
            CreatedBy = dept.CreatedBy;
            CreatedDate = dept.CreatedDate;
            DEPTCode = dept.DEPTCode;
            ModifiedBy = dept.ModifiedBy;
            ModifiedDate = dept.ModifiedDate;
            Name = dept.Name;
            Order = dept.Order;
            ParentName = dept.ParentDepartment == null ? "无上级" : dept.ParentDepartment.Name;
            ParentDEPTCode = dept.ParentDEPTCode;
            ParentDepartment = dept.ParentDepartment;
            RecordState = dept.RecordState;
        }
    }
}